package com.glsc.ngateway.common.api.platform.dto.it.networkassets;

import cn.hutool.core.annotation.Alias;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.glsc.ngateway.common.api.common.dto.BaseEntityDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.SuperBuilder;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDate;

/**
 * 维保信息维护
 *
 * @author xuchang
 */
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@JsonInclude
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
public class MaintenanceInformationDto extends BaseEntityDto implements Serializable {

    private static final long serialVersionUID = -6319601955919834026L;

    @Alias(value = "网络资产序列号")
    @ApiModelProperty(value = "网络资产序列号")
    private String serialNum;

    @Alias(value = "维保信息")
    @ApiModelProperty(value = "维保信息")
    private String maintenanceInfo;

    @Alias(value = "合同编号")
    @ApiModelProperty(value = "供应商")
    private String supplier;

    @Alias(value = "开始日期")
    @ApiModelProperty(value = "开始日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonDeserialize(using = LocalDateDeserializer.class)
    protected LocalDate start;

    @Alias(value = "结束日期")
    @ApiModelProperty(value = "结束日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonDeserialize(using = LocalDateDeserializer.class)
    protected LocalDate end;

    @Alias(value = "关联OA")
    @ApiModelProperty(value = "关联OA")
    private String bindOa;
}
